<?php

namespace App\Http\Controllers\Wechat;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Wechat\BaseController;
use  App\Libraries\classs\PhpRedis;

class RankController extends BaseController
{
    public  function index(){
        return view('wechat.rank.index');
    }

   public function stars(Request $request){
       $data =array('success'=>false);
      if($request->ajax()){
          $build_star_rank= PhpRedis::getInstance()->getRedisStarRank();
          $data['data']=$build_star_rank;
          $data['success']=true;
      }
       return response()->json($data);
   }

    public function count(Request $request){
        $data =array('success'=>false);
        if($request->ajax()){
           $build_count_rank= PhpRedis::getInstance()->getRedisCountRank();
            $data['data']=$build_count_rank;
            $data['success']=true;
        }
        return response()->json($data);
    }
}
